package com.lrs.java.j2se_self.lastJava;

public class TestThread2 {
	public static void main(String[] args){
		Thread t2 = new Thread( new Runner4());
		t2.start();
		Thread t1 = new Thread(new Runner3(t2));
		t1.start();
		/*
		try{
			Thread.sleep(1000);
		}catch(InterruptedException e){
			return;
		}
		*/
		//t2.start();
		/*
		try{
			t1.join();
		}catch(InterruptedException e){
			e.printStackTrace();
		}
		*/
	}
}

class Runner3 implements Runnable{
	public Thread t = null;
	public Runner3(Thread t){
		this.t = t;
	}
	public void run(){
		try{
			t.join();
		}catch(InterruptedException e){
			e.printStackTrace();
		}
		for(int i=0; i<1000;i++){
			System.out.println("the thread ____"+ i);
		}
	}
}
class Runner4 implements Runnable {
	public void run(){
		for(int i=0; i<100; i++){
			System.out.println("the second thread" + i);
		}
	}
}